﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SampleCardCreat.aspx.cs"
    Inherits="PPAP.Web.Master.SampleCardCreat" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script language="javascript">
        function add() {
            url = "SampleCardEdit.aspx";
            PopUpWindow(url, 130, 60, 950, 580);
        }
        function edit(id) {
            url = "SampleCardEdit.aspx?DID=" + id;
            PopUpWindow(url, 130, 60, 950, 580);
        }
        function del(id) {
            if (confirm('Please confirm to delete the file.')) {
                url = "SampleCardCreat.aspx?deid=" + id;
                window.location.href = url;
            }
        }
    </script>
</head>
<body style="font-family: Arial, Helvetica, sans-serif;">
    <form id="form1" runat="server">
    <div>
    <font size='-1' color='gray'>Current position:Master data>>Sample card</font>
        <table width="100%" style="display: none;">
            <tr>
                <td>
                    Sample card
                </td>
                <td>
                    <asp:TextBox autocomplete="off"   ID="txtTest" runat="server"></asp:TextBox><font color='red'>*</font>
                </td>
                <td>
                    Department
                </td>
                <td>
                    <asp:DropDownList ID="ddlDepartment" runat="server">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td>
                    Test items
                </td>
                <td>
                    <asp:TextBox autocomplete="off"   ID="txtRemark" runat="server"></asp:TextBox><font color='red'>*</font>
                </td>
                <td>
                    &nbsp;
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td colspan="4" align="right">
                    <asp:Button ID="Button1" CssClass="button" runat="server" Text="Add" OnClick="Button1_Click"
                        OnClientClick="return confirm('Are you sure you want to save?');" />
                </td>
            </tr>
        </table>
        <table width="100%">
            <tr>
                <td align="right">
                    <input value="Add" onclick="javascript:add();" class="button" type="button" />
                </td>
            </tr>
        </table>
        <asp:GridView ID="GridView1" runat="server" CellPadding="4" Width="100%" ForeColor="#333333"
            GridLines="None" AutoGenerateColumns="False" AllowSorting="true" 
            onsorting="GridView1_Sorting">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:TemplateField HeaderText="No." FooterText="No." HeaderStyle-Font-Size="12px"  ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("rownum") %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Sample card" FooterText="Sample card" SortExpression="TESTITEMNAME" HeaderStyle-Font-Size="12px"  ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Eval("TESTITEMNAME") %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Department" FooterText="Department" SortExpression="department" HeaderStyle-Font-Size="12px"  ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%# Eval("department") %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Create time" FooterText="Create time" SortExpression="CREATETIME" HeaderStyle-Font-Size="12px"  ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label ID="Label4" runat="server" Text='<%#Eval("CREATETIME").ToString()==""?"":DateTime.Parse(Eval("CREATETIME").ToString()).ToString("yyyy-MM-dd")  %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Created by" FooterText="Created by" SortExpression="createby" HeaderStyle-Font-Size="12px"  ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label ID="Label5" runat="server" Text='<%# Eval("createby") %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Test items" Visible="false" FooterText="Test items" SortExpression="REMARK" HeaderStyle-Width="400px" HeaderStyle-Font-Size="12px"  ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label ID="Label6" runat="server" Text='<%# Eval("REMARK") %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Left"></ItemStyle>
                </asp:TemplateField>
                <asp:HyperLinkField DataNavigateUrlFields="ID" HeaderStyle-Font-Size="12px"  Visible="false" HeaderText="Edit"
                    ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" DataNavigateUrlFormatString="SampleCardCreat.aspx?DID={0}"
                    Text="Edit" />
                <asp:TemplateField HeaderText="Edit" FooterText="Edit" HeaderStyle-Font-Size="12px"  ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton2" Visible="false" PostBackUrl='<%#"javascript:edit("+Eval("ID")+");" %>'
                            runat="server">Edit</asp:LinkButton>
                        <img src="../Images/newimg/write.png" title="Edit" onclick="<%#"javascript:edit("+Eval("ID")+");" %>" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Delete" FooterText="Delete" HeaderStyle-Font-Size="12px"  ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton1" Visible="false" runat="server" OnClientClick="return confirm('Please confirm to delete the file.')"
                            PostBackUrl='<%# "SampleCardCreat.aspx?deid="+Eval("ID") %>'>Delete</asp:LinkButton>
                        <img src="../Images/newimg/delete.png" title="Delete" onclick="<%#"javascript:del("+Eval("ID")+");" %>" />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <EditRowStyle BackColor="#2E8AC5" />
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#E7E8E8" Font-Bold="True" ForeColor="#000000" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Left" />
            <RowStyle BackColor="#EFF3FB" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#F5F7FB" />
            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
            <SortedDescendingCellStyle BackColor="#E9EBEF" />
            <SortedDescendingHeaderStyle BackColor="#4870BE" />
        </asp:GridView>
    </div>
    </form>
</body>
</html>
